<template>
  <div class="sidebar">
    <router-link
      v-for="item in menuItems"
      :key="item.path"
      :to="item.path"
      v-slot="{ isActive, navigate }"
      custom
    >
      <div
        :class="['menu-item', { active: isActive }]"
        @click="navigate"
      >
        <span class="icon">{{ item.icon }}</span>
        <span class="label">{{ item.label }}</span>
      </div>
    </router-link>
  </div>
</template>

<script setup lang="ts">
const menuItems = [
  { path: '/convert', label: '格式转换', icon: '🔄' },
  { path: '/compress', label: '视频压缩', icon: '📦' },
  { path: '/separate', label: '音视频分离', icon: '✂️' },
  { path: '/watermark', label: '水印处理', icon: '💧' },
  { path: '/editor', label: '视频编辑', icon: '✏️' }
]
</script>

<style scoped>
.sidebar {
  width: 200px;
  background: white;
  border-right: 1px solid #e0e0e0;
  padding: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.menu-item:hover {
  background: #f0f0f0;
}

.menu-item.active {
  background: #3498db;
  color: white;
}

.icon {
  font-size: 20px;
  margin-right: 12px;
}

.label {
  font-size: 14px;
  font-weight: 500;
}
</style>
